import requests

url ="http://www.baike.com"
response = requests.get(url)
# 设置编码为防止乱码
response.encoding = "utf-8"
# 内容 text
# print(response.text)

# 返回bytes  decode可以不传参 不传也是默认解码
print(response.content.decode('utf-8'))

# 响应对于的请求头
print(response.request.headers)

# cookies
print(response.cookies)

# 状态码
print(response.status_code)

# 是否成功
print(response.ok)